Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying an archival policy for AWS buckets #3563

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

yuvipanda
Copy link
Member

@yuvipanda yuvipanda commented Jan 2, 2024

Only enables this for openscapes, which is using it as described in 2i2c-org/features#32.


📚 Documentation preview 📚: https://2i2c-pilot-hubs--3563.org.readthedocs.build/en/3563/

@yuvipanda yuvipanda requested a review from a team as a code owner January 2, 2024 23:01
@yuvipanda
Copy link
Member Author

I have already applied this.

@consideRatio
Copy link
Member

I did a terraform plan on a cluster where this hasn't been applied yet and where archival_storageclass_after wasn't configured (victor) and got this.

Terraform will perform the following actions:

  # aws_s3_bucket_lifecycle_configuration.user_bucket_expiry["scratch"] will be updated in-place
  ~ resource "aws_s3_bucket_lifecycle_configuration" "user_bucket_expiry" {
        id     = "victor-scratch"
        # (1 unchanged attribute hidden)

      + rule {
          + id     = "archival-storageclass"
          + status = "Enabled"

          + transition {
              + storage_class = "GLACIER_IR"
            }
        }

        # (1 unchanged block hidden)
    }

  # aws_s3_bucket_lifecycle_configuration.user_bucket_expiry["scratch-staging"] will be updated in-place
  ~ resource "aws_s3_bucket_lifecycle_configuration" "user_bucket_expiry" {
        id     = "victor-scratch-staging"
        # (1 unchanged attribute hidden)

      + rule {
          + id     = "archival-storageclass"
          + status = "Enabled"

          + transition {
              + storage_class = "GLACIER_IR"
            }
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

It seems off that the rule is created and put in a Enabled state even if archival_storageclass_after is an optional defaulting to null hasn't been explicitly configured. It also renders to an ambugious rule if the transition.days is omitted.

@consideRatio
Copy link
Member

@yuvipanda if the final form of this PR will make terraform apply in other clusters apply something harmless, it could be good if you ping engineers about it to provide a heads up that this is a change they can expect to show and not worry about.

@yuvipanda yuvipanda marked this pull request as draft January 4, 2024 01:25
@yuvipanda
Copy link
Member Author

Thanks for the check, @consideRatio. I'm actually going to investigate if that stanza can be just made conditional entirely (instead of using enabled / disabled), so it's a no-op elsewhere. If not, I'll post to make sure other engineers are aware of a no-op change.

@yuvipanda yuvipanda marked this pull request as ready for review January 16, 2024 04:31
@yuvipanda
Copy link
Member Author

@consideRatio ok, updated so it is a no-op on clusters that don't use this feature.

Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yuvipanda!

I merged this branch to master locally and tested applying this on 2i2c-aws-us: No changes. Your infrastructure matches the configuration..

@consideRatio consideRatio changed the title Allow specifying an archival policy for buckets Allow specifying an archival policy for AWS buckets Feb 14, 2024
@consideRatio
Copy link
Member

consideRatio commented Feb 14, 2024

I'll go for a merge here to ensure we get this in and we don't drop the ball on this - as I did now for a month.

Testing to apply this on openscapes led to No changes. Your infrastructure matches the configuration. as well.

@consideRatio consideRatio merged commit 834ae39 into 2i2c-org:master Feb 14, 2024
4 checks passed
@yuvipanda
Copy link
Member Author

Thank you, @consideRatio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

2 participants